Method and Apparatus of Deblocking Filter

ABSTRACT

A method and apparatus for improved deblocking filter are disclosed. In one embodiment according to the present invention, determining the non-zero transform coefficients existence for a PU-only boundary is skipped and therefore the deblocking filter for PU-only boundary is eliminated if the condition of boundary strength equal to 1 is not fulfilled to avoid unnecessary deblocking. In another embodiment of the present invention, three gradients are determined for two pixel lines and filter ON/OFF decision is made based on the three gradient values of the two pixel lines. One aspect of the invention is related to filter strength selection between strong and weak filters. According to one embodiment, the filter strength selection is based on various gradient values of a pixel line across the block boundary. Another aspect of the invention is related to the weak filter.

CROSS REFERENCE TO RELATED APPLICATIONS

The present invention claims priority to U.S. Provisional PatentApplication Ser. No. 61/451,289, filed Mar. 10, 2011, entitled “ImprovedDeblocking Filter”. The U.S. Provisional patent applications is herebyincorporated by reference in its entirety.

FIELD OF INVENTION

The present invention relates to video coding. In particular, thepresent invention relates to the deblocking filter.

BACKGROUND OF THE INVENTION

Motion compensated transform coding has been widely adopted in variouscoding standards, where block transform is applied to motion-compensatedresidues. The motion compensated inter-frame coding system also usesintra-frame mode periodically or adaptively.

During the coding process, transform coefficients are quantized in orderto reduce bitrate and consequently artifacts are introduced. Theartifacts are more visible at boundaries around transform blocks. Inorder to alleviate the coding artifacts, a technique called deblockinghas been developed which applied filtering across block boundariesadaptively. The deblocking technique is also called deblocking filter inthe field of video coding.

While the conventional deblocking filter has shown to reduce codingartifacts, the process might have been applied unnecessarily in somecircumstances. Furthermore, the deblocking filter may be designed withcharacteristics to improve performance. Accordingly, it is desirable todesign a new deblocking filter to avoid applying deblocking filterunnecessarily and consequently to deliver improved performance.

SUMMARY OF THE INVENTION

A method and apparatus for deblocking of reconstructed video in a videocoding system are disclosed. In one embodiment according to the presentinvention, the method and apparatus for deblocking of reconstructedvideo in a video coding system skip determining the non-zero transformcoefficients existence for a PU-only boundary. The method may assignsmaller block strength to the PU-only boundary. Zero-valued blockstrength is used to disable deblocking for to the PU-only boundary. Inanother embodiment of the present invention, three gradients aredetermined for two pixel lines and filter ON/OFF decision is made basedon the three gradients of the two pixel lines. The absolute values ofthe gradients are compared with respective thresholds and the resultsare used to determine filter ON/OFF. One aspect of the invention isrelated to filter strength selection between strong and weak filters. Inone embodiment of the present invention, the strength selection is basedon the gradient between two first boundary pixels across the blockboundary, three gradients associated with the first and the secondboundary pixels, the first and the third boundary pixels, and the firstand the fourth boundary pixels on one side of the block boundary, andrespective three gradients on the other side of the block boundary.Another aspect of the invention is related to the weak filter. In orderto preserve edge sharpness when the weak filter is selected, oneembodiment according to the present invention conditionally applies theweak filter to the second boundary pixel on each side of the blockboundary. The condition is based on the gradient between the first andthe third boundary pixels on each side of the block boundary.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an exemplary vertical block boundary between twoneighboring blocks and pixel lines across the boundary.

FIG. 2 illustrates an example of dependence of thresholds a, and A, andclipping variable tc on quantization parameter (QP).

DETAILED DESCRIPTION

For digital video compression, motion compensated inter-frame coding isan effective compression technique and has been widely adopted invarious coding standards, such as MPEG-1/2/4 and H.261/H.263/H.264/AVC.In a motion compensated system, motion estimation/compensation andsubsequent compression is often performed on a block by block basis.During compression process, coding noises may arise due to lossyoperations such as quantization. The coding artifacts may becomenoticeable in the reconstructed video data, especially at or near blockboundaries of block-based transform. In order to alleviate thevisibility of coding artifacts, a technique called deblocking has beenused in newer coding systems such as H.264/AVC and the High EfficiencyVideo Coding (HEVC) system being developed. Furthermore, HEVC adopts aseparate unit for block-based prediction, named prediction unit (PU),which may be different from the transform unit (TU). Consequently, theboundaries of PUs may not be aligned with the boundaries of TUs. InHEVC, the deblocking process is based on 8×8 block for both luma andchroma components.

FIG. 1 shows an example of a vertical boundary to be filtered betweentwo block A 110 and block B 120 shown as thick boxes in FIG. 1, whereeach block consists of 8×8 pixels. Eight pixel lines associated with thetwo neighboring blocks are labeled from 131 through 138 as shown inFIG. 1. Four pixels on each side of the vertical boundary are labeled as(p3 _(i), p2 _(i), p1 _(i), p0 _(i), q0 _(i), q1 _(i), q2 _(i), q3_(i)), where i the index for the pixel lines and i=0, . . . , 7. Pixelsimmediately next to the block boundary, i.e., p0 _(i) and q0 _(i), arenamed first boundary pixels. Similarly, p1 _(i) and q1 _(i) are namedsecond boundary pixels, p2 _(i) and q2 _(i) are named third boundarypixels and p3 _(i) and q3 _(i) are named fourth boundary pixels. In thisexample, block A 110 and block B 120 can be two PUs or TUs. Thedeblocking process includes steps of determining filter ON/OFF,determining filter strength and applying deblocking filter. The filterON/OFF decision checks if the transition at the boundary is a naturaledge or is caused by coding artifacts. If it is a natural edge, thefilter is turned OFF to preserve the sharpness of the picture associatedwith the respective boundary. Otherwise, the deblocking filter is turnedON to reduce the artifacts. The filter ON/OFF decision is firstperformed for all block boundaries of the respective picture area to befiltered. If a boundary is to be filtered, filter strength decision,i.e., selecting a strong or weak filter, will be determined.Subsequently, a deblocking filter with the determined filter strength isapplied to the boundary to be filtered. The deblocking process is termedas deblocking for convenience in this disclosure. The deblocking processis also called deblocking filter in the field of video coding. Thefilter used for deblocking is also called deblocking filter. Therefore,the term deblocking filter may refer to the deblocking process or thefilter used for deblocking depending on the context.

In order to keep the computational complexity low, the filter ON/OFFdecision according to conventional HEVC is determined based on only twopixel lines. For example, in HM-3.0, line 2 and line 5 are used. Edgeactivity measure, d is computed based on pixels in lines 2 and 5:

d=|p2₂−2p1₂ +p0₂ |+|q2₂−2q1₂ +q0₂ |+|p2₅−2p1₅ +p0₅ |+|q2₅−2q1₅+q0₅|.  (1)

If the Edge activity measure d is smaller than a pre-defined thresholdβ, the corresponding block boundary will be filtered. The pre-definedthreshold, β is related to quantization parameter (QP). If a blockboundary is determined to be filtered, the weak/strong filter decisionis then performed line by line according to the conditions:

d<β>>2,  (2)

|p3_(i) −p0_(i) |+|q3_(i) −q0_(i)|<β>>3, and  (3)

|p0_(i) −q0_(i)|<5·tc+1,  (4)

where tc is another pre-defined threshold related to QP, which is usedto avoid over-filtering pixels. If all three conditions above aresatisfied, a strong filer is selected. Otherwise a weak filter isselected.

The deblocking filter for chroma components is similar to that for theluma component, but it is only used for intra block boundaries. Althoughdeblocking filter used in conventional HEVC has the advantage of lowcomplexity, performance could be improved. For example, the filterON/OFF decision based on a single edge activity measurement d and asingle threshold β may not lead to proper edge activity measure.Furthermore, the filter strength decision based on the gradients betweenthe fourth boundary pixel (p3/q3) and the first pixel (p0/q0) may notproperly reflect the true edge gradients. Moreover, the boundarystrength (BS) derivation and weak filter operation also need to berefined accordingly. In conventional HEVC, deblocking filter isconsidered for a block boundary if one of the two neighboring blocks hasnon-zero transform coefficients. The above decision is made regardlesswhether the boundary is a PU boundary or a TU boundary. The abovedeblocking filter practice is inherited from the H.264 standard, wherethe transform size is always equal to or smaller than the predictionpartition size. Furthermore, deblocking filter is applied to a boundaryif the boundary strength is greater than 0, and deblocking filter isdisabled when the boundary strength is 0. The boundary strengthassignment according to HEVC Test Model version 3.0 (HM-3.0) is shown inTable 1.

TABLE 1 Boundary Block modes and conditions strength (BS) One of theblocks is Intra 3 or 4 One of the blocks has non-zero transform 2coefficients Difference of block motion vector >=1 1 integer luma sampledistance Motion compensation from different 1 reference frames Else 0

According to Table 1, the boundary strength is 3 or 4 when theprediction mode of at least one of the blocks is intra mode depending onwhether the boundary is the largest coding unit (LCU) boundary or not,and the boundary strength is 2 when at least one of the blocks hasnon-zero transform coefficients. The boundary strength assignmentfurther checks if the blocks use different reference frames or differentnumber of motion vectors. In HM-3.0, a TU may cover several PUs so thata PU boundary may not be always a TU boundary. As shown in Table 1, aPU-only boundary (inside one TU) will have a BS value equal to 2 if oneof the blocks has non-zero transform coefficients. Accordingly,deblocking filter with BS equal to 2 will be applied to the PU-onlyboundary, which is not desirable since there are no block-basedtransform artifacts. Accordingly, an embodiment of the present inventionskips determining the non-zero transform coefficients existence forPU-only boundary, and therefore eliminates deblocking filter for PU-onlyboundary by lowering the boundary strength to 0 if other conditions ofBS equal to 1, i.e. motion vector difference and reference frames, arenot fulfilled, while the HM-3.0 assigns boundary strength (BS) to 2 forthe PU-only luma boundary having non-zero transform coefficients for oneof the two neighboring blocks. The boundary strength assignmentaccording to an embodiment of the present invention is shown in Table 2.

TABLE 2 Boundary Block modes and conditions strength (BS) One of theblocks is Intra 3 or 4 The boundary is a TU boundary and one of 2 theblocks has non-zero transform coefficients Difference of block motionvector >=1 1 integer luma sample distance Motion compensation fromdifferent 1 reference frames Else 0

In recent HM-6.0, the BS value assignment is further cleaned up, inwhich only 3 BS values, i.e. 0, 1 and 2, are used. Therefore, theinvention could also been changed accordingly. Compared to Table 2, BSvalue is changed to 2 when the prediction mode of at least one of theblocks is intra mode, and BS value is changed to 1 when the boundary isTU boundary and at least one of the blocks has non-zero transformcoefficients. In this case, the PU-only boundary is still not filteredif the conditions of motion vector difference and reference frames arenot fulfilled.

One aspect of the present invention addresses deblocking filterdecisions. In one embodiment according to the present invention, thefilter ON/OFF decision is based on the following conditions:

|p0_(i) −q0_(i) |<Tα,  (5)

|p1_(i) −p0_(i) |<Tβ, and  (6)

|q1_(i) −q0_(i) |<Tβ,  (7)

where thresholds α and β are derived according to:

$\begin{matrix}{\alpha = \left\{ \begin{matrix}{{\left( {{5\alpha_{i}} + 2} \right)\operatorname{>>}2},} & {{if}\mspace{14mu} A\mspace{14mu} {or}\mspace{14mu} B\mspace{14mu} {is}\mspace{14mu} {intra}} \\{\alpha_{i},} & {{otherwise},}\end{matrix} \right.} & (8) \\{\beta = \left\{ \begin{matrix}{{\beta_{i}{\operatorname{<<}2}},} & {{if}\mspace{14mu} A\mspace{14mu} {or}\mspace{14mu} B\mspace{14mu} {is}\mspace{14mu} {intra}} \\{{\beta_{i}{\operatorname{<<}1}},} & {{otherwise},}\end{matrix} \right.} & (9)\end{matrix}$

where α_(i) and β_(i) are dependent on QP of luma as shown in FIG. 2.The block boundary (8 pixel lines) will be filtered if equations (5),(6) and (7) are all satisfied for both i=2 and 5. In this embodiment,pixel data associated with a pixel line across a block boundary betweena first block and a second block are received to determine a firstgradient as shown in equation (5), a second gradient as shown inequation (6), and a third gradient as shown in equation (7), for thepixel line. The first gradient is measured between a first boundarypixel of the first block and a first boundary pixel of the second block.The second gradient is measured between a second boundary pixel of thefirst block and the first boundary pixel of the second block. The thirdgradient is measured between the first boundary pixel of the first blockand the second boundary pixel of the second block. Pixel data associatedwith another pixel line across the same block boundary are also receivedto determine the first, second, and third gradients for the pixel line.In this embodiment, the two pixel lines are line 2 and line 5. Thefilter ON/OFF decision is determined based on the three gradients forline 2 and the three gradients for line 5, that is, the block boundary(8 pixel lines) will be filtered if equations (5), (6) and (7) are allsatisfied for both pixel lines

After the filter ON/OFF decision is made for the block boundary betweenblocks A and B is determined, one of the two filters (i.e., weak orstrong filter) will be selected for each pixel line if the filter isdetermined to be ON for the block boundary. An embodiment according tothe present invention uses more gradients between different pixelpositions to provide better measurement of edge gradients, where theedge gradients are measured according to:

|p0_(i) −q0_(i)|<(α>>2)−(α>>4), and  (10)

|q1_(i) −q0_(i) |+|q2_(i) −q0_(i) |+|q3_(i) −q0_(i) |+|p1_(i) −p0_(i)|+|p2_(i) −p0_(i) |+|p3_(i) −p0_(i)|<((β_(i)−4)<<2).  (11)

For each pixel line, the strong filter is selected if both conditions inequations (10) and (11) are satisfied. Otherwise, the weak filter isselected. Specifically, pixel data associated with a pixel line across ablock boundary between a first block and a second block are received. Afirst gradient for the pixel line is measured between a first boundarypixel of the first block and a first boundary pixel of the second block,as shown in equation (10). A second gradient, a third gradient, and afourth gradient for the pixel line in the first block are alsodetermined. The second gradient is measured between the first boundarypixel and a second boundary pixel of the first block; the third gradientis measured between the first boundary pixel and a third boundary pixelof the first block; and the fourth gradient is measured between thefirst boundary pixel and a fourth boundary pixel of the first block.Similarly, the second gradient, the third gradient, and the fourthgradient for the pixel line in the second block are also determined. Thefilter strength for the block boundary is determined according to thesecond gradient, the third gradient and the fourth gradient of the firstblock, the second gradient, the third gradient and the fourth gradientof the second block, and the first gradient. For example, thesegradients are compared with thresholds to decide the filter strength,and deblocking filter is applied to the block boundary according to thefilter strength.

Another aspect of the present invention addresses weak filter design. InHM-3.0, the luma weak filter is always applied to the second boundarypixels (i.e., p1 and q1). In order to avoid damaging the edge cross thesecond boundary pixel, an embodiment according to the present inventionperforms the weak filter conditionally. A test is performed to determinewhether the pixel should be filtered or not. Furthermore, a weak filterwith modified coefficients is used according to the present invention.Specifically, the filtered values of p0′ and q0′ are calculatedaccording to:

Δ₀=clip(−tc,tc,(12(q0−p0)−3(q1−p1)+16)>>5),  (12)

p0′=p0+Δ₀, and  (13)

q0′=q0−Δ₀.  (14)

The value of p1 is modified only if the condition,

|p0−p2|<β_(i)−4,  (15)

is true and the filtered value p1′ of p1 is calculated according to:

Δ_(p1)=clip(−tc,tc,(12(p0−p1)−3(q0−p2)+16)>>5), and  (16)

p1′=p1+(Δ_(p1)>>1).  (17)

Similarly, the value of q1 is modified only if the condition,

|q0−q2|<β_(i)−4,  (18)

is true and the filtered value q1′ of q1 is calculated according to:

Δ_(q1)=clip(−tc,tc,(12(q0−q1)−3(p0−q2)+16)>>5), and   (19)

q1′=q1+(Δ_(q1)>>1),  (20)

where the clipping variable tc can be found in FIG. 2.

In conventional HEVC, a single adjustment value Δ is used to derivefiltered values p0′, q0′, p1′ and q1′. According to an embodiment of thepresent invention, Δ₀, Δ_(p1), and Δ_(q1) are calculated separatelyusing three short-tap filters defined in (12), (16), and (19). Theindividual adjustment values, Δ₀, Δ_(p1), and Δ_(q1) can lead to betterfilter result since the weak deblocking filter according to the presentinvention will be able to tailor to the individual characteristics ofthe pixels. In addition, p0′, q0′, p1′ and q1′ are derived based on thesame formula with different parameters. Therefore, the weak filter maybe implemented with the same logic and the hardware complexity isreduced.

In the above disclosure, derivation of filter ON/OFF decision, filterstrength decision and weak filter modification are illustrated for avertical block boundary. Derivation for a horizontal boundary can bedone similarly. The deblocking technique according to the presentinvention can be applied to the luma component as well as the chromacomponents.

Embodiment of video systems incorporating encoding or decoding ofdeblocking filter according to the present invention as described abovemay be implemented in various hardware, software codes, or a combinationof both. For example, an embodiment of the present invention can be acircuit integrated into a video compression chip or program codesintegrated into video compression software to perform the processingdescribed herein. An embodiment of the present invention may also beprogram codes to be executed on a Digital Signal Processor (DSP) toperform the processing described herein. The invention may also involvea number of functions to be performed by a computer processor, a digitalsignal processor, a microprocessor, or field programmable gate array(FPGA). These processors can be configured to perform particular tasksaccording to the invention, by executing machine-readable software codeor firmware code that defines the particular methods embodied by theinvention. The software code or firmware codes may be developed indifferent programming languages and different format or style. Thesoftware code may also be compiled for different target platform.However, different code formats, styles and languages of software codesand other means of configuring code to perform the tasks in accordancewith the invention will not depart from the spirit and scope of theinvention.

The invention may be embodied in other specific forms without departingfrom its spirit or essential characteristics. The described examples areto be considered in all respects only as illustrative and notrestrictive. The scope of the invention is, therefore, indicated by theappended claims rather than by the foregoing description. All changeswhich come within the meaning and range of equivalency of the claims areto be embraced within their scope.

1. A method of deblocking of reconstructed video in a video codingsystem, wherein said deblocking is adaptively applied to blockboundaries of the reconstructed video, and each block corresponds to aprediction unit (PU) or a transform unit (TU), the method comprising:receiving pixel data associated with a block boundary between twoblocks; determining if one of the two blocks has non-zero transformcoefficients only when the block boundary is a TU boundary; assigning afirst value to block strength for the block boundary if one of the twoblocks has non-zero transform coefficients and the block boundary is theTU boundary; assigning a second value to the block strength for theblock boundary if the block boundary is only a PU boundary, wherein thesecond value is smaller than or equal to the first value; and applyingsaid deblocking to the block boundary according to the block strength,and wherein filter strength of said deblocking is related to the blockstrength.
 2. The method of claim 1, wherein said determining if one ofthe two blocks has non-zero transform coefficients is skipped for aPU-only boundary.
 3. The method of claim 1, wherein the second value iszero when a predetermined criterion is fulfilled, and said deblocking isnot applied to the block boundary.
 4. A method of deblocking ofreconstructed video in a video coding system, wherein said deblocking isadaptively applied to block boundaries of the reconstructed video, themethod comprising: receiving pixel data associated with a first pixelline across a block boundary between a first block and a second block;determining a first gradient, a second gradient, and a third gradientfor the first pixel line, wherein the first gradient is measured betweena first boundary pixel of the first block and the first boundary pixelof the second block; wherein the second gradient is measured between asecond boundary pixel of the first block and the first boundary pixel ofthe second block; and wherein the third gradient is measured between thefirst boundary pixel of the first block and the second boundary pixel ofthe second block; receiving the pixel data associated with a secondpixel line across the block boundary; determining the first gradient,the second gradient, and the third gradient for the second pixel line;determining filter ON/OFF for the block boundary according to the firstgradient, the second gradient, and the third gradient of the first pixelline and the first gradient, the second gradient, and the third gradientof the second pixel line; and applying deblocking to the block boundaryaccording to the filter ON/OFF.
 5. The method of claim 4, wherein saiddetermining filter ON/OFF is based on a first test, a second test and athird test; wherein the first test checks if absolute value of the firstgradient is smaller than a first threshold; wherein the second testchecks if the absolute value of the second gradient is smaller than asecond threshold; wherein the third test checks if the absolute value ofthe third gradient is smaller than the second threshold; and wherein thefilter ON/OFF is set to ON if the first test, the second test and thethird test are true for the first line and the second line.
 6. Themethod of claim 5, wherein the first threshold and the second thresholdare dependent on quantization parameters of the first block and thesecond block.
 7. A method of deblocking of reconstructed video in avideo coding system, wherein said deblocking is adaptively applied toblock boundaries of the reconstructed video, the method comprising:receiving pixel data associated with a pixel line across a blockboundary between a first block and a second block; determining a firstgradient for the pixel line, wherein the first gradient is measuredbetween a first boundary pixel of the first block and the first boundarypixel of the second block; determining a second gradient, a thirdgradient, and a fourth gradient for the pixel line in the first block,wherein the second gradient is measured between the first boundary pixeland a second boundary pixel of the first block; wherein the thirdgradient is measured between the first boundary pixel and a thirdboundary pixel of the first block; and wherein the fourth gradient ismeasured between the first boundary pixel and a fourth boundary pixel ofthe first block; determining the second gradient, the third gradient,and the fourth gradient for the pixel line in the second block;determining filter strength for the block boundary according to thesecond gradient, the third gradient and the fourth gradient of the firstblock, the second gradient, the third gradient and the fourth gradientof the second block, and the first gradient; and applying deblocking tothe block boundary according to the filter strength.
 8. The method ofclaim 7, wherein said determining filter strength is based on a firsttest and a second test; wherein the first test checks if absolute valueof the first gradient is smaller than a first threshold; wherein thesecond test checks if sum of the absolute values of the second gradient,the third gradient and the fourth gradient of the first block and thesecond block is smaller than a second threshold; and wherein a strongfilter is selected if the first test and the second test are true and aweak filter is selected otherwise.
 9. The method of claim 8, wherein thefirst threshold and the second threshold are dependent on quantizationparameters of the first block and the second block.
 10. A method ofdeblocking of reconstructed video in a video coding system, wherein saiddeblocking is adaptively applied to blocks of the reconstructed video,the method comprising: receiving pixel data associated with a pixel lineacross a block boundary between a first block and a second block;determining a first flag based on a first gradient measured between afirst boundary pixel and a third boundary pixel of the first block;applying deblocking to a second boundary pixel of the first blockselectively according to the first flag; determining a second flag basedon a second gradient measured between the first boundary pixel and thethird boundary pixel of the second block; and applying said deblockingto the second boundary pixel of the second block selectively accordingto the second flag.
 11. The method of claim 10, wherein said deblockingis applied to the second boundary pixel of the first block only ifabsolute value of the first gradient is smaller than a threshold; andwherein said deblocking is applied to the second boundary pixel of thesecond block only if the absolute value of the second gradient issmaller than the threshold.
 12. The method of claim 11, wherein thethreshold is dependent on quantization parameters of the first block andthe second block.
 13. An apparatus of deblocking of reconstructed videoin a video coding system, wherein said deblocking is adaptively appliedto block boundaries of the reconstructed video, and each blockcorresponds to a prediction unit (PU) or a transform unit (TU), theapparatus comprising: means for receiving pixel data associated with ablock boundary between two blocks; means for determining if one of thetwo blocks has non-zero transform coefficients only when the blockboundary is a TU boundary; means for assigning a first value to blockstrength for the block boundary if one of the two blocks has non-zerotransform coefficients and the block boundary is the TU boundary; meansfor assigning a second value to the block strength for the blockboundary if the block boundary is only a PU boundary, wherein the secondvalue is smaller than or equal to the first value; and means forapplying said deblocking to the block boundary according to the blockstrength, and wherein filter strength of said deblocking is related tothe block strength.
 14. An apparatus of deblocking of reconstructedvideo in a video coding system, wherein said deblocking is adaptivelyapplied to block boundaries of the reconstructed video, the apparatuscomprising: means for receiving pixel data associated with a first pixelline across a block boundary between a first block and a second block;means for determining a first gradient, a second gradient, and a thirdgradient for the first pixel line, wherein the first gradient ismeasured between first boundary pixel of the first block and the firstboundary pixel of the second block; wherein the second gradient ismeasured between second boundary pixel of the first block and the firstboundary pixel of the second block; and wherein the third gradient ismeasured between the first boundary pixel of the first block and thesecond boundary pixel of the second block; means for receiving the pixeldata associated with a second pixel line across the block boundary;means for determining the first gradient, the second gradient, and thethird gradient for the second pixel line; means for determining filterON/OFF for the block boundary according to the first gradient, thesecond gradient, and the third gradient of the first pixel line and thefirst gradient, the second gradient, and the third gradient of thesecond pixel line; and means for applying deblocking to the blockboundary according to the filter ON/OFF.
 15. An apparatus of deblockingof reconstructed video in a video coding system, wherein said deblockingis adaptively applied to block boundaries of the reconstructed video,the apparatus comprising: means for receiving pixel data associated witha pixel line across a block boundary between a first block and a secondblock; means for determining a first gradient for the pixel line,wherein the first gradient is measured between first boundary pixel ofthe first block and the first boundary pixel of the second block; meansfor determining a second gradient, a third gradient, and a fourthgradient for the pixel line in the first block, wherein the secondgradient is measured between first boundary pixel and second boundarypixel of the first block; wherein the third gradient is measured betweenthe first boundary pixel and third boundary pixel of the first block;and wherein the fourth gradient is measured between the first boundarypixel and fourth boundary pixel of the first block; means fordetermining the second gradient, the third gradient, and the fourthgradient for the pixel line in the second block; means for determiningfilter strength for the block boundary according to the second gradient,the third gradient and the fourth gradient of the first block, thesecond gradient, the third gradient and the fourth gradient of thesecond block, and the first gradient; and means for applying deblockingto the block boundary according to the filter strength.
 16. An apparatusof deblocking of reconstructed video in a video coding system, whereinsaid deblocking is adaptively applied to blocks of the reconstructedvideo, the apparatus comprising: means for receiving pixel dataassociated with a pixel line across a block boundary between a firstblock and a second block; means for determining a first flag based onfirst gradient measured between first boundary pixel and third boundarypixel of the first block; means for applying deblocking to secondboundary pixel of the first block selectively according to the firstflag; means for determining a second flag based on second gradientmeasured between the first boundary pixel and the third boundary pixelof the second block; and means for applying said deblocking to thesecond boundary pixel of the second block selectively according to thesecond flag.